package gui.mockview;

import gui.batches.ITransferItemBatchController;
import gui.batches.ITransferItemBatchView;
import gui.batches.TransferItemBatchController;
import gui.inventory.ProductContainerData;
import gui.item.ItemData;
import gui.product.ProductData;

public class MockTransferView implements ITransferItemBatchView {
	private String barcode;
	private ITransferItemBatchController controller;
	
	public MockTransferView(ProductContainerData data) {
		barcode = "";
		controller = new TransferItemBatchController(this, data);
	}

	@Override
	public void setBarcode(String barcode) {
		this.barcode = barcode;
		
		if (controller != null) {
			controller.barcodeChanged();
		}
	}

	@Override
	public String getBarcode() {
		return barcode;
	}
	
	/**
	 * Make the controller transfer an item
	 * */
	public void transferItem() {
		controller.transferItem();
	}
	
	/**
	 * Force the controller to undo an action
	 * */
	public void undo() {
		controller.undo();
	}
	
	/**
	 * Force the controller to redo an action
	 * */
	public void redo() {
		controller.redo();
	}

	//unimplemented methods
	@Override
	public void displayInformationMessage(String message) {}
	@Override
	public void displayWarningMessage(String message) {}
	@Override
	public void displayErrorMessage(String message) {}
	@Override
	public void close() {}
	@Override
	public void giveBarcodeFocus() {}
	@Override
	public void setUseScanner(boolean value) {}
	@Override
	public boolean getUseScanner() {return false;}
	@Override
	public void enableItemAction(boolean value) {}
	@Override
	public void enableUndo(boolean value) {}
	@Override
	public void enableRedo(boolean value) {}
	@Override
	public void setProducts(ProductData[] products) {}
	@Override
	public ProductData getSelectedProduct() {return null;}
	@Override
	public void selectProduct(ProductData product) {}
	@Override
	public void setItems(ItemData[] items) {}
	@Override
	public ItemData getSelectedItem() {return null;}
	@Override
	public void selectItem(ItemData item) {}

}
